﻿using Crawler.WebEntities;
using System;
using System.Collections.Generic;
using System.Text;

namespace Crawler.DataHelper
{
    public static class VisitedHelper
    {
        /// <summary>
        /// 向visited表中插入新纪录
        /// </summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public static bool InsertToVisited(MyUri uri)
        {
            bool isSucceedInsert = true;
            MysqlHelper helper = new MysqlHelper();
            isSucceedInsert = helper.InsertVisited(uri);
            return isSucceedInsert;
        }
        /// <summary>
        /// 判断地址是否已被访问过
        /// </summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public static bool IsVisited(MyUri uri)
        {
            MysqlHelper helper = new MysqlHelper();
            return helper.IsVisited(uri);
        }
        public static void DelAllVisited()
        {
            MysqlHelper helper = new MysqlHelper ();
            helper.Del_All_Visited();
        }
    }
}
